# coding:utf-8
from PyQt6.QtWidgets import QButtonGroup
from qfluentwidgets import HeaderCardWidget, FlowLayout, TogglePushButton


class FlowTitleCard(HeaderCardWidget):
    def _postInit(self):
        self.flowLayout = FlowLayout()

        self.setObjectName("flow_title_card")
        self.viewLayout.addLayout(self.flowLayout)

    def addButton(self, text: str, data=None):
        button = TogglePushButton(text, self)
        button.setCheckable(True)
        button.setProperty('data', data)
        self.flowLayout.addWidget(button)
        return button
